   var phone = getvl("phone");
$(function(){
    $("#phone").html("");
    	  if(phone!=null){
    	  	   $("#phone").val(phone);
    	  }
   });
   
  /* function  yanzhengma(){
     	   var phone=$("#phone").val();
   	   $.ajax({       
          url: urlcore + "/api/user/selectuserag?types=1&iphone="+phone,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
                  yanzhen(phone);                   
				} else {
				  alert("error1");
				}
			},
			error: function() {
				alert("error");
			}
		});
   	       
   	       
   	
   }*/
   
   
   
    function yanzhen(){
    	var phone=$("#phone").val();
    	 if(!(/^1(3|4|5|7|8)\d{9}$/.test(phone))) {
		alert("手机号码有误");
		return;
	} else {
	       	$.ajax({       
          url: urlcore + "/api/user/getPhoneCode?type=1&phone="+phone,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
                alert("注意查收");                    
				} else {
				alert("error1");
				}
			},
			error: function() {
				alert("error");
			}
		});
		
	       }
    	
    }
    
    
  function selectalls(){
  	alert("123")
    var phone=$("#phone").val();
  	  var code=$("#code").val();
  	  if (!(/^1(3|4|5|7|8)\d{9}$/.test(phone))){ 
	            	alert("手机号码有误");
	            	return;
	  }else{
	  	if(code!=''){
	  		$.ajax({ 
 url: urlcore + "/api/user/checkOldPhone?phone="+phone+"&code="+code,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					if(data.msg!="" && data.msg!=null){
				sessionStorage.setItem("checkOldPhone2",data.msg);
				   window.location.href="12.7.8shezhi_xiugaishouji_xin.html";
					}
				
				} else {
				  alert("操作失败！");
				}
			},
			error: function() {
				alert("error");
			}
		});
	  	}else{
	  		alert("验证码填写错误");
	            	return;
	  	}
		 }

  }

 function selectalls2(phone,code){
  	  //alert(113)
	  		$.ajax({ 
             url: urlcore + "/api/user/checkOldPhone?phone="+phone+"&code="+code,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					alert("成功")
				} else {
				  alert("操作失败！");
				}
			},
			error: function() {
				alert("error");
			}
		});
	  	
		

  }